package com.mc.service.impl;

import com.mc.bean.Teacher;
import com.mc.dao.Impl.TeacherDaoImpl;
import com.mc.dao.TeacherDao;
import com.mc.service.TeacherService;

import java.util.List;

/**
 * @author zh
 * 老师实体数据接口实现
 */
public class TeacherServiceImpl implements TeacherService {
    TeacherDao teacherDao=new TeacherDaoImpl();
    @Override
    public List<Teacher> findAll() {
        return teacherDao.findAll();
    }

    @Override
    public Teacher findByTid(int tid) {
        return teacherDao.findByTid(tid);
    }

    @Override
    public Teacher findByTelPass(String tel, String pass) {
        return teacherDao.findByTelPass(tel,pass);
    }

    @Override
    public boolean add(Teacher teacher) {
        return teacherDao.add(teacher)>0?true:false;

    }

    @Override
    public boolean delete(int tid) {
        return teacherDao.delete(tid)>0?true:false;

    }

    @Override
    public boolean update(Teacher teacher) {
        return teacherDao.update(teacher)>0?true:false;
    }

    @Override
    public Teacher findByTel(String tel) {
        return teacherDao.findBytel(tel);
    }
}
